package com.jungle.bfi.domain.bo;

import com.jungle.base.criteria.Condition;
import lombok.Data;

import java.util.List;

@Data
public class ApiPathBo {
    private String id;
    @Condition
    private String apiId;
    private String type;
    private String title;
    private String parentId;
    private float sort;
    private String description;

    private List<String> tags;
    @Condition
    private String path;
    private String method;
    private String summary;
    private String contentType;
    /**
     * 返回数据类型
     */
    private String schemaType;
    /**
     * 返回参数类型
     */
    private String schemaRef;

    @Override
    public String toString() {
        String tag = tags == null ? "" : tags.get(0);
        return "{" +
                " path='" + path + '\'' +
                ", tags='" + tag + '\'' +
                ", title='" + title + '\'' +
                '}';
    }

//    public Specification<ApiPathPo> toTitleSpec() {
//        return ((root, query, cb) -> cb.and(
//                cb.equal(root.get("apiId"), this.apiId),
//                cb.equal(root.get("title"), this.title))
//        );
//    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getApiId() {
        return apiId;
    }

    public void setApiId(String apiId) {
        this.apiId = apiId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public float getSort() {
        return sort;
    }

    public void setSort(float sort) {
        this.sort = sort;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getSchemaType() {
        return schemaType;
    }

    public void setSchemaType(String schemaType) {
        this.schemaType = schemaType;
    }

    public String getSchemaRef() {
        return schemaRef;
    }

    public void setSchemaRef(String schemaRef) {
        this.schemaRef = schemaRef;
    }
}
